#pragma once

namespace common { namespace tokdoc { class Node; } }
class D3dTextureFromFile;

struct ShaderConstant
{
	string Name;

	ShaderConstant(common::tokdoc::Node *node);
	virtual ~ShaderConstant() { }
	virtual bool IsLoaded() { return true; }
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning) = 0;
};

struct BoolShaderConstant : public ShaderConstant
{
	bool Value;

	BoolShaderConstant(common::tokdoc::Node *node);
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

struct IntShaderConstant : public ShaderConstant
{
	int Value;

	IntShaderConstant(common::tokdoc::Node *node);
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

struct FloatShaderConstant : public ShaderConstant
{
	float Value;

	FloatShaderConstant(common::tokdoc::Node *node);
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

struct Float4ShaderConstant : public ShaderConstant
{
	VEC4 Value;

	Float4ShaderConstant(common::tokdoc::Node *node);
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

struct Float4x4ShaderConstant : public ShaderConstant
{
	MATRIX Value;

	Float4x4ShaderConstant(common::tokdoc::Node *node);
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

struct TextureShaderConstant : public ShaderConstant
{
	D3dTextureFromFile *Texture; // Not released

	TextureShaderConstant(common::tokdoc::Node *node);
	virtual bool IsLoaded();
	virtual bool SetInEffect(ID3DXEffect *eff, bool logWarning);
};

